package com.chen.entity.bean;


import com.chen.entity.Menu;
import com.chen.entity.User;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author chenchao
 * @date 2022/7/17 18:09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo implements Serializable {

    private static final long serialVersionUID = 1L;
    private Integer id;
    private String username;
    private String email;
    private String nickname;
    private Integer age;
    private String address;
    private String sex;
    private Date birthday;
    private String role;
    private String points;
    private String avatar;
    private List<Menu> menus;
    private String token;
    private String code;


    public UserInfo(User user) {
        this.id = user.getId();
        this.username = user.getUsername();
        this.nickname = user.getNickname();
        this.age = user.getAge();
        this.birthday = user.getBirthday();
        this.email = user.getEmail();
        this.sex = user.getSex();
        this.points = user.getPoints();
        this.role = user.getRole();
        this.address = user.getAddress();
        this.avatar = user.getAvatar();
        this.menus = user.getMenus();
        this.token = user.getToken();
        this.code = user.getCode();
    }

}
